<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue-2.4.0.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="msg">
    {{msg|upper}}
    {{msg|upper|lower}}
    <div :abc="msg|upper">测试数据</div>
</div>
<script>
    Vue.filter('upper',(val)=>{
        return val.charAt(0).toUpperCase()+val.slice(1)
    })
    Vue.filter('lower',(val)=>{
        return val.charAt(1).toLowerCase()+val.slice(1)
    })
    var vm=new Vue({
        el:'#app',
        data:{
            msg:''
        },
        methods:{},
        filters:{}
    })
</script>
</body>
</html>
